package com.bw.seckill_module.bind;

import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.databinding.BindingAdapter;

import com.bw.imgload_sdk.LoadImgUtils;
import com.bw.seckill_module.R;
import com.bw.seckill_module.entity.GoodsEntity;

public class SecKillValueBind {

    @BindingAdapter(value = {"entity"})
    public static void bindSecKillValue(LinearLayout linearLayout, GoodsEntity entity){
        if (entity != null){
            ImageView value_head_img = linearLayout.findViewById(R.id.value_head_img);
            TextView value_head_title = linearLayout.findViewById(R.id.value_head_title);
            TextView value_head_dec = linearLayout.findViewById(R.id.value_head_dec);
            LoadImgUtils.loadMatchImg(entity.goods_default_icon,value_head_img);
            value_head_title.setText(entity.goods_desc);
            value_head_dec.setText(entity.goods_default_sku);
        }
    }

}
